Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(content analytics) fixes #30521 : Allow users to pass down simple Strings to query for Content Analytics data #30847

Conversation

jcastro-dotcms
Copy link
Contributor

@jcastro-dotcms jcastro-dotcms commented Dec 3, 2024

Proposed Changes

  • This code change allows users to pass down simple Strings to query for Content Analytics data.
  • Considering the formatting of different values, a special notation must be used to specify certain parameters in the URL path.
  • You can do a POST REST call using a JSON body like this one:
{
    "measures": "request.count request.totalSessions",
    "dimensions": "request.host request.whatAmI request.url",
    "timeDimensions": "request.createdAt:day:Last month",
    "filters": "request.totalRequest gt 0:request.whatAmI contains PAGE,FILE",
    "order": "request.count asc:request.createdAt asc",
    "limit": 5,
    "offset": 0
}

The following must be taken into account when putting a query together:

  • Measures: Values are separated by blank spaces: request.count request.totalSessions
  • Dimensions: Values are separated by blank spaces: request.host request.whatAmI request.url
  • Time Dimensions: Values are separated by colons: request.createdAt:day:This month . The second parameter 'day' -- the "granularity" parameter -- is optional.
  • Filters: Values are separated by colons: request.totalRequest gt 0:request.whatAmI contains PAGE,FILE . In this case, you're filtering by the number of requests, and the type of object being queried: Pages and Files.
  • Order: Values are separated by colon: request.count asc:request.createdAt asc
  • Limit: Value is provided as is: 50
  • Offset: Value is provided as is: 0

This PR fixes: #30521

@jcastro-dotcms jcastro-dotcms added this pull request to the merge queue Dec 4, 2024
@jcastro-dotcms jcastro-dotcms removed this pull request from the merge queue due to a manual request Dec 4, 2024
@jcastro-dotcms
Copy link
Contributor Author

After discussion with the team, the code for the new Endpoint will be changed to use a JSON body instead of path parameters.

… includes a simplified version of the query sent to the Content Analytics service.
…tics-query-endpoint-that-doesnt-require-map' into issue-30521-Create-content-analytics-query-endpoint-that-doesnt-require-map
@jcastro-dotcms jcastro-dotcms added this pull request to the merge queue Dec 5, 2024
Merged via the queue into main with commit 6d24366 Dec 5, 2024
36 checks passed
@jcastro-dotcms jcastro-dotcms deleted the issue-30521-Create-content-analytics-query-endpoint-that-doesnt-require-map branch December 5, 2024 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create content analytics query endpoint that doesn't require map
4 participants